package com.design.yjx.command.remote;

import com.design.yjx.command.common.Fan;
import com.design.yjx.command.common.FanOffCommand;
import com.design.yjx.command.common.FanOnCommand;
import com.design.yjx.command.common.Light;
import com.design.yjx.command.common.LightOffCommand;
import com.design.yjx.command.common.LightOnCommand;

/**
 * @author yuanjianxin
 * @date 2017/8/21 14:24
 */
public class Main {
    public static void main(String[] args) {
        RemoteControl control = new RemoteControl();

        //电灯命令
        Light light = new Light();
        LightOnCommand lightOnCommand = new LightOnCommand(light);
        LightOffCommand lightOffCommand = new LightOffCommand(light);

        //电扇命令
        Fan fan = new Fan();
        FanOnCommand fanOnCommand = new FanOnCommand(fan);
        FanOffCommand fanOffCommand = new FanOffCommand(fan);



        control.setCommand(1,lightOnCommand,lightOffCommand);
        control.setCommand(2,fanOnCommand,fanOffCommand);


        control.onButtonWasPushed(1);
        control.undoButtonWasPushed();
        control.offButtonWasPushed(1);
        control.onButtonWasPushed(2);
        control.offButtonWasPushed(2);
        control.undoButtonWasPushed();

    }
}
